<?php /*a:4:{s:70:"D:\laragon\www\uavshop\application\manage\view\distribution_index.html";i:1573546920;s:56:"D:\laragon\www\uavshop\application\manage\view\base.html";i:1596192950;s:65:"D:\laragon\www\uavshop\application\manage\view\public_editor.html";i:1540951044;s:65:"D:\laragon\www\uavshop\application\manage\view\public_upload.html";i:1591401853;}*/ ?>
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
	<meta name="renderer" content="webkit">
<title>后台管理系统</title>
<link rel="stylesheet" href="/static/public/awesome/css/font-awesome.min.css" />

<link rel="stylesheet" href="/static/public/layui/css/layui.css" />

<link rel="stylesheet" href="/static/public/kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="/static/manage/css/style.css" />

	<link rel="stylesheet" href="/static/public/dist/zoomify.min.css">
	
<script src="/static/public/kindeditor/kindeditor-all.js"></script>
<script src="/static/public/kindeditor/lang/zh_CN.js"></script>
<script src="/static/public/ueditor/ueditor.config.js?t=<?php echo time();?>"></script>
<script src="/static/public/ueditor/ueditor.all.min.js"></script>
<script src="/static/public/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<body>
<?php if($is_auth): ?>

<script language="javascript" type="text/javascript" src="/static/public/My97DatePicker/WdatePicker.js"></script>
<script>
    var uploadJson = '<?php echo url("api/v1/upload", ["path" => session("userid", "", session_prefix()), "module" => request()->module() ?: "addons"]); ?>';
    var fileManagerJson = '<?php echo url("api/v1/filemanager", ["sub_path" => session("userid", "", session_prefix()), "module" => request()->module() ?: "addons"]); ?>';
</script>

<div class="g-main">

    <div class="m-main-title">

        <div class="m-container-fluid">

            <a href="<?php echo url('index/welcome'); ?>"><i class="icon icon-home"></i>首页</a>

            <span class="icon-angle-right"></span>

            <span>系统</span>

            <span class="icon-angle-right"></span>

            <span>分销管理</span>

            <span class="icon-angle-right"></span>

            <span>分销设置</span>

            <a class="u-flush"><i class="icon-repeat"></i></a>

        </div>

    </div>

    <div class="m-main-content">

        <div class="m-container">

            <div class="m-tab-tit clearfix">

                <ul>

                    <li><a href="javascript:;">基本设置</a></li>

                    <li><a href="javascript:;">下线关系</a></li>

                    <li><a href="javascript:;">分销资格</a></li>

                    <li><a href="javascript:;">结算设置</a></li>

                    <li><a href="javascript:;">申请设置</a></li>

                    <li><a href="javascript:;">文字设置</a></li>

                </ul>

            </div>

            <div class="m-form mt-10">

                <form class="layui-form" id="j_form">

                    <div class="m-tab-con">

                        <table class="m-table">

                            <thead>

                            <tr>

                                <th colspan="2">基本设置</th>

                            </tr>

                            </thead>

                            <tbody>

                            <tr>
                                <td width="15%"><label>分销层级</label></td>
                                <td>
                                    <input type="radio" lay-filter="commission_level" name="db[commission_level]" value="0" title="不开启" <?php if(isset($db['commission_level']) && ($db['commission_level'] == 0)): ?> checked<?php endif; ?>  />
                                    <input type="radio" lay-filter="commission_level" name="db[commission_level]" value="1" title="一级分销" <?php if(isset($db['commission_level']) && ($db['commission_level'] == 1)): ?> checked<?php endif; ?> />
                                    <input type="radio" lay-filter="commission_level" name="db[commission_level]" value="2" title="二级分销" <?php if(isset($db['commission_level']) && ($db['commission_level'] == 2)): ?> checked<?php endif; ?> />
                                </td>
                            </tr>

                            <tr id="commission_charge_type">
                                <td width="15%"><label>佣金类型</label></td>
                                <td>
                                    <input type="radio" lay-filter="commission_charge_type" name="db[commission_charge_type]" value="1" title="百分比" <?php if(isset($db['commission_charge_type']) && ($db['commission_charge_type'] == 1)): ?> checked<?php endif; ?> />
                                    <input type="radio" lay-filter="commission_charge_type"  name="db[commission_charge_type]" value="0" title="固定金额" <?php if(isset($db['commission_charge_type']) && ($db['commission_charge_type'] == 0)): ?> checked<?php endif; ?> />
                                </td>
                            </tr>

                            <tr id="commission_charge_first">
                                <td><label>一级佣金</label></td>
                                <td><input type="text" name="db[commission_charge_first]" class="u-ipt u-ipt-def"
                                           value="<?php echo htmlentities((isset($db['commission_charge_first']) && ($db['commission_charge_first'] !== '')?$db['commission_charge_first']:'')); ?>"/><span class="danwei">元</span></td>
                            </tr>
                            <tr id="commission_charge_second">
                                <td><label>二级佣金</label></td>
                                <td><input type="text" name="db[commission_charge_second]" class="u-ipt u-ipt-def"
                                           value="<?php echo htmlentities((isset($db['commission_charge_second']) && ($db['commission_charge_second'] !== '')?$db['commission_charge_second']:'')); ?>"/><span class="danwei">元</span></td>
                            </tr>

                            <tr>
                                <td width="15%"><label>分销内购</label></td>
                                <td>
                                    <input type="radio" name="db[commission_self_buy]" value="1" title="是" <?php if(isset($db['commission_self_buy']) && ($db['commission_self_buy'] == 1)): ?> checked<?php endif; ?> />
                                    <input type="radio" name="db[commission_self_buy]" value="0" title="否" <?php if(isset($db['commission_self_buy']) && ($db['commission_self_buy'] == 0)): ?> checked<?php endif; ?> />
                                </td>
                            </tr>

                            <tr>
                                <td width="15%"><label>佣金显示</label></td>
                                <td>
                                    <input type="radio" name="db[commission_charge_show]" value="1" title="是" <?php if(isset($db['commission_charge_show']) && ($db['commission_charge_show'] == 1)): ?> checked<?php endif; ?> />
                                    <input type="radio" name="db[commission_charge_show]" value="0" title="否" <?php if(isset($db['commission_charge_show']) && ($db['commission_charge_show'] == 0)): ?> checked<?php endif; ?> />
                                </td>
                            </tr>

                            <tr>
                                <td width="15%"><label>分销海报显示</label></td>
                                <td>
                                    <input type="radio" name="db[commission_poster_show]" value="1" title="是" <?php if(isset($db['commission_poster_show']) && ($db['commission_poster_show'] == 1)): ?> checked<?php endif; ?> />
                                    <input type="radio" name="db[commission_poster_show]" value="0" title="否" <?php if(isset($db['commission_poster_show']) && ($db['commission_poster_show'] == 0)): ?> checked<?php endif; ?> />
                                </td>
                            </tr>

                            <tr>
                                <td width="15%"><label>排行榜显示</label></td>
                                <td>
                                    <input type="radio" name="db[commission_ranking_show]" value="1" title="是" <?php if(isset($db['commission_ranking_show']) && ($db['commission_ranking_show'] == 1)): ?> checked<?php endif; ?> />
                                    <input type="radio" name="db[commission_ranking_show]" value="0" title="否" <?php if(isset($db['commission_ranking_show']) && ($db['commission_ranking_show'] == 0)): ?> checked<?php endif; ?> />
                                </td>
                            </tr>


                            </tbody>

                        </table>

                    </div>

                    <div class="m-tab-con dn">

                        <table class="m-table">

                            <thead>

                            <tr>

                                <th colspan="2">下线关系</th>

                            </tr>

                            </thead>

                            <tbody>

                            <tr>
                                <td width="15%"><label>成为下线条件</label></td>
                                <td>
                                    <input type="radio" name="db[commission_become_child]" value="1" title="首次进入" <?php if(isset($db['commission_become_child']) && ($db['commission_become_child'] == 1)): ?> checked<?php endif; ?> />
                                    <input type="radio" name="db[commission_become_child]" value="2" title="首次下单" <?php if(isset($db['commission_become_child']) && ($db['commission_become_child'] == 2)): ?> checked<?php endif; ?> />
                                    <input type="radio" name="db[commission_become_child]" value="3" title="首次付款" <?php if(isset($db['commission_become_child']) && ($db['commission_become_child'] == 3)): ?> checked<?php endif; ?> />
                                </td>
                            </tr>


                            </tbody>

                        </table>

                    </div>

                    <div class="m-tab-con dn">

                        <table class="m-table">

                            <thead>

                            <tr>

                                <th colspan="3">分销资格</th>

                            </tr>

                            </thead>

                            <tbody>

                            <tr>
                                <td width="15%"><label>成为分销商条件</label></td>
                                <td>
                                    <input type="radio" lay-filter="commission_become"  name="db[commission_become]" value="0" title="无条件" <?php if(isset($db['commission_become']) && ($db['commission_become'] == 0)): ?> checked<?php endif; ?> />
                                    <input type="radio" lay-filter="commission_become" name="db[commission_become]" value="1" title="申请" <?php if(isset($db['commission_become']) && ($db['commission_become'] == 1)): ?> checked<?php endif; ?> />
                                    <input type="radio" lay-filter="commission_become" name="db[commission_become]" value="2" title="消费次数" <?php if(isset($db['commission_become']) && ($db['commission_become'] == 2)): ?> checked<?php endif; ?> />
                                    <input type="radio" lay-filter="commission_become" name="db[commission_become]" value="3" title="消费额度" <?php if(isset($db['commission_become']) && ($db['commission_become'] == 3)): ?> checked<?php endif; ?> />
                                    <input type="radio" lay-filter="commission_become" name="db[commission_become]" value="4" title="购买商品" <?php if(isset($db['commission_become']) && ($db['commission_become'] == 4)): ?> checked<?php endif; ?> />
                                </td>
                            </tr>
                            <tr id="commission_become_order_count">

                                <td><label>分销商消费必须达</label></td>

                                <td><input type="text" class="u-ipt u-ipt-longer"
                                           name="db[commission_become_order_count]"
                                           value="<?php echo htmlentities((isset($db['commission_become_order_count']) && ($db['commission_become_order_count'] !== '')?$db['commission_become_order_count']:'')); ?>"/><span>次</span></td>

                            </tr>
                            <tr id="commission_become_money_count">

                                <td><label>分销商消费必须达</label></td>

                                <td><input type="text" class="u-ipt u-ipt-longer"
                                           name="db[commission_become_money_count]"
                                           value="<?php echo htmlentities((isset($db['commission_become_money_count']) && ($db['commission_become_money_count'] !== '')?$db['commission_become_money_count']:'')); ?>"/><span>元</span></td>

                            </tr>

                            <tr id="commission_become_goods_id">

                                <td><label>分销商必须购买</label></td>

                                <td>
                                    <div class="lay-select m-select-def">
                                        <select name="commission_become_goods_id" lay-filter="commission_become_goods_id">
                                            <option value="0">请选择商品</option>
                                            <?php if(isset($db['commission_become_goods_id'])): if(is_array($goods) || $goods instanceof \think\Collection || $goods instanceof \think\Paginator): if( count($goods)==0 ) : echo "" ;else: foreach($goods as $key=>$v): ?>
                                            <option value="<?php echo htmlentities($v['id']); ?>"<?php if($db['commission_become_goods_id'] == $v['id']): ?> selected<?php endif; ?>><?php echo htmlentities($v['goods_name']); ?></option>
                                            <?php endforeach; endif; else: echo "" ;endif; endif; ?>
                                        </select>
                                    </div>

                                </td>

                            </tr>


                            <tr>
                                <td width="15%"><label>分销商是否需要审核</label></td>
                                <td>
                                    <input type="radio" name="db[commission_become_check]" value="1" title="是" <?php if(isset($db['commission_become_check']) && ($db['commission_become_check'] == 1)): ?> checked<?php endif; ?> />
                                    <input type="radio" name="db[commission_become_check]" value="0" title="否" <?php if(isset($db['commission_become_check']) && ($db['commission_become_check'] == 0)): ?> checked<?php endif; ?> />
                                </td>
                            </tr>


                            </tbody>

                        </table>

                    </div>

                    <div class="m-tab-con dn">

                        <table class="m-table">

                            <thead>

                            <tr>

                                <th colspan="4">结算设置</th>

                            </tr>

                            </thead>

                            <tbody>

                            <tr>
                                <td width="15%"><label>提现方式</label></td>
                                <td>
                                    <input type="checkbox" name="db[commission_withdraw_type][]" title="提现到微信" value="1"
                                           lay-skin="primary" <?php if(isset($db['commission_withdraw_type']) && is_array($db['commission_withdraw_type']) && in_array(1, $db['commission_withdraw_type'])): ?> checked<?php endif; ?>>
                                    <input type="checkbox" name="db[commission_withdraw_type][]" title="提现到支付宝"
                                           value="2" lay-skin="primary" <?php if(isset($db['commission_withdraw_type']) && is_array($db['commission_withdraw_type']) && in_array(2, $db['commission_withdraw_type'])): ?> checked<?php endif; ?>>
                                    <input type="checkbox" name="db[commission_withdraw_type][]" title="提现到银行卡"
                                           value="3" lay-skin="primary" <?php if(isset($db['commission_withdraw_type']) && is_array($db['commission_withdraw_type']) && in_array(3, $db['commission_withdraw_type'])): ?> checked<?php endif; ?>>
                                    <input type="checkbox" name="db[commission_withdraw_type][]" title="提现到商城余额"
                                           value="4" lay-skin="primary" <?php if(isset($db['commission_withdraw_type']) && is_array($db['commission_withdraw_type']) && in_array(4, $db['commission_withdraw_type'])): ?> checked<?php endif; ?>>
                                </td>
                            </tr>

                            <tr>

                                <td><label for="commission_withdraw_least">最少提现额度</label></td>

                                <td><input type="text" class="u-ipt u-ipt-longer" name="db[commission_withdraw_least]"
                                           id="commission_withdraw_least"
                                           value="<?php echo htmlentities((isset($db['commission_withdraw_least']) && ($db['commission_withdraw_least'] !== '')?$db['commission_withdraw_least']:'')); ?>"/><span>元</span></td>

                            </tr>

                            <tr>

                                <td><label for="commission_withdraw_charge">提现手续费</label></td>

                                <td><input type="text" class="u-ipt u-ipt-longer" name="db[commission_withdraw_charge]"
                                           id="commission_withdraw_charge"
                                           value="<?php echo htmlentities((isset($db['commission_withdraw_charge']) && ($db['commission_withdraw_charge'] !== '')?$db['commission_withdraw_charge']:'')); ?>"/><span>%</span></td>

                            </tr>

                            <tr>

                                <td><label for="commission_settle_days">佣金计算天数</label></td>

                                <td><input type="text" class="u-ipt u-ipt-longer" name="db[commission_settle_days]"
                                           id="commission_settle_days"
                                           value="<?php echo htmlentities((isset($db['commission_settle_days']) && ($db['commission_settle_days'] !== '')?$db['commission_settle_days']:'')); ?>"/><span>天</span></td>

                            </tr>


                            </tbody>

                        </table>

                    </div>

                    <div class="m-tab-con dn">

                        <table class="m-table">

                            <thead>

                            <tr>

                                <th colspan="5">申请设置</th>

                            </tr>

                            </thead>

                            <tbody>

                            <tr>

                                <td width="15%"><label for="">申请页宣传图片</label></td>
                                <td>
                                    <button type="button" class="layui-btn u-upload-pic"
                                            data-name="db[commission_apply_banner]"><i class="layui-icon">&#xe67c;</i>上传图片
                                    </button>
                                    <div class="m-pic">
                                        <ul>
                                            <?php echo attach_html($db['commission_apply_banner'],
                                            'db[commission_apply_banner]'); ?>
                                        </ul>
                                    </div>
                                </td>
                            </tr>

                            <tr>
                                <td width="15%"><label>申请必须完善资料</label></td>
                                <td>
                                    <input type="radio" name="db[commission_apply_full_info]" value="1" title="是" <?php if(isset($db['commission_apply_full_info']) && ($db['commission_apply_full_info'] == 1)): ?> checked<?php endif; ?> />
                                    <input type="radio" name="db[commission_apply_full_info]" value="0" title="否" <?php if(isset($db['commission_apply_full_info']) && ($db['commission_apply_full_info'] == 0)): ?> checked<?php endif; ?> />
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2"><label>申请协议</label></td>
                            </tr>
                            <tr>
                                <td colspan="2"><textarea name="db[commission_apply_agree]" style="width:100%;height:300px;visibility:hidden;">
                                    <?php echo htmlentities((isset($db['commission_apply_agree']) && ($db['commission_apply_agree'] !== '')?$db['commission_apply_agree']:'')); ?></textarea></td>

                                <script>
                                    KindEditor.ready(function (K) {
                                        var editor = K.create('textarea[name="db\\[commission_apply_agree\\]"]', {
                                            allowFileManager: true,
                                            uploadJson: uploadJson,
                                            fileManagerJson: fileManagerJson,
                                            afterBlur: function () {
                                                this.sync();
                                            }
                                        });
                                    });
                                </script>
                            </tr>

                            </tbody>

                        </table>

                    </div>

                    <div class="m-tab-con dn">

                        <table class="m-table">

                            <thead>

                            <tr>

                                <th colspan="6">文字设置</th>

                            </tr>

                            </thead>

                            <tbody>

                            <tr>

                                <td><label for="commission_text_center">分销中心</label></td>

                                <td><input type="text" class="u-ipt u-ipt-longer" name="db[commission_text_center]"
                                           id="commission_text_center" placeholder="默认为'分销中心'"
                                           value="<?php echo htmlentities((isset($db['commission_text_center']) && ($db['commission_text_center'] !== '')?$db['commission_text_center']:'分销中心')); ?>"/><span></span></td>

                            </tr>
                            <tr>

                                <td><label for="commission_text_agent">分销商</label></td>

                                <td><input type="text" class="u-ipt u-ipt-longer" name="db[commission_text_agent]"
                                           id="commission_text_agent" placeholder="默认为'分销商'"
                                           value="<?php echo htmlentities((isset($db['commission_text_agent']) && ($db['commission_text_agent'] !== '')?$db['commission_text_agent']:'分销商')); ?>"/><span></span></td>

                            </tr>
                            <tr>

                                <td><label for="commission_text_charge">佣金</label></td>

                                <td><input type="text" class="u-ipt u-ipt-longer" name="db[commission_text_charge]"
                                           id="commission_text_charge" placeholder="默认为'佣金'"
                                           value="<?php echo htmlentities((isset($db['commission_text_commission_order']) && ($db['commission_text_commission_order'] !== '')?$db['commission_text_commission_order']:'佣金')); ?>"/><span></span>
                                </td>

                            </tr>
                            <tr>

                                <td><label for="commission_text_withdraw">提现</label></td>

                                <td><input type="text" class="u-ipt u-ipt-longer" name="db[commission_text_withdraw]"
                                           id="commission_text_withdraw" placeholder="默认为'提现'"
                                           value="<?php echo htmlentities((isset($db['commission_text_withdraw']) && ($db['commission_text_withdraw'] !== '')?$db['commission_text_withdraw']:'提现')); ?>"/><span></span></td>

                            </tr>
                            <tr>

                                <td><label for="commission_text_commission_charge">分销佣金</label></td>

                                <td><input type="text" class="u-ipt u-ipt-longer"
                                           name="db[commission_text_commission_charge]"
                                           id="commission_text_commission_charge" placeholder="默认为'分销佣金'"
                                           value="<?php echo htmlentities((isset($db['commission_text_commission_charge']) && ($db['commission_text_commission_charge'] !== '')?$db['commission_text_commission_charge']:'分销佣金')); ?>"/><span></span>
                                </td>

                            </tr>
                            <tr>

                                <td><label for="commission_text_commission_order">分销订单</label></td>

                                <td><input type="text" class="u-ipt u-ipt-longer"
                                           name="db[commission_text_commission_order]"
                                           id="commission_text_commission_order" placeholder="默认为'分销订单'"
                                           value="<?php echo htmlentities((isset($db['commission_text_commission_order']) && ($db['commission_text_commission_order'] !== '')?$db['commission_text_commission_order']:'分销订单')); ?>"/><span></span>
                                </td>

                            </tr>
                            <tr>

                                <td><label for="commission_text_visible_withdraw_charge">可提现佣金</label></td>

                                <td><input type="text" class="u-ipt u-ipt-longer"
                                           name="db[commission_text_visible_withdraw_charge]"
                                           id="commission_text_visible_withdraw_charge" placeholder="默认为'可提现佣金'"
                                           value="<?php echo htmlentities((isset($db['commission_text_visible_withdraw_charge']) && ($db['commission_text_visible_withdraw_charge'] !== '')?$db['commission_text_visible_withdraw_charge']:'可提现佣金')); ?>"/><span></span>
                                </td>

                            </tr>
                            <tr>

                                <td><label for="commission_text_applied_charge">已申请佣金</label></td>

                                <td><input type="text" class="u-ipt u-ipt-longer"
                                           name="db[commission_text_applied_charge]" id="commission_text_applied_charge"
                                           placeholder="默认为'已申请佣金'"
                                           value="<?php echo htmlentities((isset($db['commission_text_applied_charge']) && ($db['commission_text_applied_charge'] !== '')?$db['commission_text_applied_charge']:'已申请佣金')); ?>"/><span></span></td>

                            </tr>
                            <tr>

                                <td><label for="commission_text_checked_charge">待打款佣金</label></td>

                                <td><input type="text" class="u-ipt u-ipt-longer"
                                           name="db[commission_text_checked_charge]" id="commission_text_checked_charge"
                                           placeholder="默认为'待打款佣金'"
                                           value="<?php echo htmlentities((isset($db['commission_text_checked_charge']) && ($db['commission_text_checked_charge'] !== '')?$db['commission_text_checked_charge']:'待打款佣金')); ?>"/><span></span></td>

                            </tr>
                            <tr>

                                <td><label for="commission_text_withdrew_charge">已提现佣金</label></td>

                                <td><input type="text" class="u-ipt u-ipt-longer"
                                           name="db[commission_text_withdrew_charge]"
                                           id="commission_text_withdrew_charge" placeholder="默认为'已提现佣金'"
                                           value="<?php echo htmlentities((isset($db['commission_text_withdrew_charge']) && ($db['commission_text_withdrew_charge'] !== '')?$db['commission_text_withdrew_charge']:'已提现佣金')); ?>"/><span></span></td>

                            </tr>
                            <tr>

                                <td><label for="commission_text_unsettled_charge">未结算佣金</label></td>

                                <td><input type="text" class="u-ipt u-ipt-longer"
                                           name="db[commission_text_unsettled_charge]"
                                           id="commission_text_unsettled_charge" placeholder="默认为'未结算佣金'"
                                           value="<?php echo htmlentities((isset($db['commission_text_unsettled_charge']) && ($db['commission_text_unsettled_charge'] !== '')?$db['commission_text_unsettled_charge']:'未结算佣金')); ?>"/><span></span></td>

                            </tr>
                            <tr>

                                <td><label for="commission_text_invalid_charge">无效佣金</label></td>

                                <td><input type="text" class="u-ipt u-ipt-longer"
                                           name="db[commission_text_invalid_charge]" id="commission_text_invalid_charge"
                                           placeholder="默认为'无效佣金'"
                                           value="<?php echo htmlentities((isset($db['commission_text_invalid_charge']) && ($db['commission_text_invalid_charge'] !== '')?$db['commission_text_invalid_charge']:'无效佣金')); ?>"/><span></span></td>

                            </tr>
                            <tr>

                                <td><label for="commission_text_child">下线</label></td>

                                <td><input type="text" class="u-ipt u-ipt-longer" name="db[commission_text_child]"
                                           id="commission_text_child" placeholder="默认为'下线'"
                                           value="<?php echo htmlentities((isset($db['commission_text_child']) && ($db['commission_text_child'] !== '')?$db['commission_text_child']:'下线')); ?>"/><span></span></td>

                            </tr>
                            <tr>

                                <td><label for="commission_text_first_child">一级下线</label></td>

                                <td><input type="text" class="u-ipt u-ipt-longer" name="db[commission_text_first_child]"
                                           id="commission_text_first_child" placeholder="默认为'一级下线'"
                                           value="<?php echo htmlentities((isset($db['commission_text_first_child']) && ($db['commission_text_first_child'] !== '')?$db['commission_text_first_child']:'一级下线')); ?>"/><span></span></td>

                            </tr>
                            <tr>

                                <td><label for="commission_text_second_child">二级下线</label></td>

                                <td><input type="text" class="u-ipt u-ipt-longer"
                                           name="db[commission_text_second_child]" id="commission_text_second_child"
                                           placeholder="默认为'二级下线'"
                                           value="<?php echo htmlentities((isset($db['commission_text_second_child']) && ($db['commission_text_second_child'] !== '')?$db['commission_text_second_child']:'二级下线')); ?>"/><span></span></td>

                            </tr>

                            <tr>

                                <td><label for="commission_text_third_child">三级下线</label></td>

                                <td><input type="text" class="u-ipt u-ipt-longer" name="db[commission_text_third_child]"
                                           id="commission_text_third_child" placeholder="默认为'三级下线'"
                                           value="<?php echo htmlentities((isset($db['commission_text_third_child']) && ($db['commission_text_third_child'] !== '')?$db['commission_text_third_child']:'三级下线')); ?>"/><span></span></td>

                            </tr>

                            <tr>

                                <td><label for="commission_text_union">元</label></td>

                                <td><input type="text" class="u-ipt u-ipt-longer" name="db[commission_text_union]"
                                           id="commission_text_union" placeholder="默认为'元'"
                                           value="<?php echo htmlentities((isset($db['commission_text_union']) && ($db['commission_text_union'] !== '')?$db['commission_text_union']:'元')); ?>"/><span></span></td>

                            </tr>


                            </tbody>

                        </table>

                    </div>

                    <div class="m-form-btn"><input type="hidden" name="option_name" value="distribution_info"/><input
                            type="hidden" name="id" value="4">
                        <button id="j_btn" class="u-btn">确定提交</button>
                    </div>

                </form>

            </div>

        </div>

    </div>

</div>


<?php endif; ?>
<input type="hidden" name="action_uri" value="<?php echo url('action'); ?>" />

<input type="hidden" name="redirect_uri" value="<?php echo url('index'); ?>" />

<input type="hidden" name="region_uri" value="/manage/regions/regions" />
<script src="/static/public/js/jquery-1.10.2.js"></script>
<script src="/static/public/js/maniac.ui.js"></script>
<script src="/static/public/layui/layui.js" charset="utf-8"></script>
<script src="/static/public/js/aes.js"></script>
<script src="/static/public/js/mode-ecb-min.js"></script>
<script src="/static/public/js/utils.js"></script>
<script src="/static/public/js/dialog.js"></script>
<script src="/static/manage/js/form.js"></script>
<script src="/static/manage/js/js.js"></script>
<script src="/static/public/js/app.js"></script>
<script src="/static/public/js/encrypt.js"></script>
<script src="/static/public/dist/zoomify.min.js"></script>
<script type="text/javascript">
    $('.fdzoom').zoomify();
</script>

<script>
var aesKey = '<?php echo htmlentities($encrypt_key); ?>';
    $(function(){
        layui.use('layer', function(){
            var user_exists = parseInt('<?php echo !empty($user_exists) ? 1  :  0; ?>');
            var user_forbidden = parseInt('<?php echo !empty($user_forbidden) ? 1  :  0; ?>');
            var quit_force = parseInt('<?php echo !empty($quit_force) ? 1  :  0; ?>');
            var is_auth    = parseInt('<?php echo !empty($is_auth) ? 1  :  0; ?>');
            
            if (user_exists) {
                dialog.error('您所登录的用户已被删除', function(){
                	top.location.href = '/manage';
                    return false;
                });
            }
            
            if (user_forbidden) {
                dialog.error('您的账户已被禁用', function(){
                	top.location.href = '/manage';
                    return false;
                });
            }

            if (quit_force) {
                dialog.error('同一账户同一时间只能一人在线', function(){
                	top.location.href = '/manage';
                    return false;
                });
            }
            
            if (!is_auth) {
                dialog.error('您没有权限执行此操作', function(){
                    window.location.href = history.go(-1);
                    return false;
                });
            }
        });
    })
</script>

<script src="/static/public/js/jquery-ui.min.js"></script>
<script>
    $(function () {
        var keyValue;
        var keyValue1;
        var keyValue2;
        keyValue = $('input[name="db[commission_level]"]:checked ').val();
        keyValue1 = $('input[name="db[commission_become]"]:checked ').val();
        keyValue2 = $('input[name="db[commission_charge_type]"]:checked ').val();
        if (keyValue == 0) {
            $("#commission_charge_type").hide();
            $("#commission_charge_first").hide();
            $("#commission_charge_second").hide();
        }
        if (keyValue == 1) {
            $("#commission_charge_type").show();
            $("#commission_charge_first").show();
            $("#commission_charge_second").hide();
        }
        if (keyValue == 2) {
            $("#commission_charge_type").show();
            $("#commission_charge_first").show();
            $("#commission_charge_second").show();
        }

        if (keyValue1 == 0 || keyValue1 == 1) {
            $("#commission_become_order_count").hide();
            $("#commission_become_money_count").hide();
            $("#commission_become_goods_id").hide();
        }
        if (keyValue1 == 2) {
            $("#commission_become_order_count").show();
            $("#commission_become_money_count").hide();
            $("#commission_become_goods_id").hide();
        }
        if (keyValue1 == 3) {
            $("#commission_become_order_count").hide();
            $("#commission_become_money_count").show();
            $("#commission_become_goods_id").hide();
        }
        if (keyValue1 == 4) {
            $("#commission_become_order_count").hide();
            $("#commission_become_money_count").hide();
            $("#commission_become_goods_id").show();
        }


        if (keyValue2 == 0) {
            $(".danwei").text('元');
        }
        if (keyValue2 == 1) {
            $(".danwei").text('%');
        }

    })
    layui.use('form', function () {
        var form = layui.form;

        form.on('radio(commission_level)', function (data) {

            if ($('input[name="db[commission_level]"]:checked ').val() == 0) {
                $("#commission_charge_type").hide();
                $("#commission_charge_first").hide();
                $("#commission_charge_second").hide();
            }
            if ($('input[name="db[commission_level]"]:checked ').val() == 1) {
                $("#commission_charge_type").show();
                $("#commission_charge_first").show();
                $("#commission_charge_second").hide();
            }
            if ($('input[name="db[commission_level]"]:checked ').val() == 2) {
                $("#commission_charge_type").show();
                $("#commission_charge_first").show();
                $("#commission_charge_second").show();
            }
            form.render();
        });

        form.on('radio(commission_charge_type)', function (data) {

            if ($('input[name="db[commission_charge_type]"]:checked ').val() == 0) {
                $(".danwei").text('元');
            }
            if ($('input[name="db[commission_charge_type]"]:checked ').val() == 1) {
                $(".danwei").text('%');
            }
            form.render();
        });

        form.on('radio(commission_become)', function (data) {

            if ($('input[name="db[commission_become]"]:checked ').val() == 0 || $('input[name="db[commission_become]"]:checked ').val() == 1) {
                $("#commission_become_order_count").hide();
                $("#commission_become_money_count").hide();
                $("#commission_become_goods_id").hide();
            }
            if ($('input[name="db[commission_become]"]:checked ').val() == 2) {
                $("#commission_become_order_count").show();
                $("#commission_become_money_count").hide();
                $("#commission_become_goods_id").hide();
            }
            if ($('input[name="db[commission_become]"]:checked ').val() == 3) {
                $("#commission_become_order_count").hide();
                $("#commission_become_money_count").show();
                $("#commission_become_goods_id").hide();
            }
            if ($('input[name="db[commission_become]"]:checked ').val() == 4) {
                $("#commission_become_order_count").hide();
                $("#commission_become_money_count").hide();
                $("#commission_become_goods_id").show();
            }
            form.render();
        });



    });



</script>
<script>

    /**

     * 上传图片

     * @param  {object}  uploader upload 对象

     * @param  {string}  ele      容器选择器

     * @param  {boolean} multiple 是否允许多图上传

     */

    function upload_pic(uploader, ele, multiple)

    {

        var signature = setSign();

        uploader.render({

            elem: ele,

            field: 'imgFile',

            multiple: multiple,

            url: '<?php echo url("/manage/upload/upload", ["path" => session("userid", "", session_prefix()), "type" => "image", "module" => request()->module() ?: "addons"]); ?>',

            headers: {signature: signature},

            done: function(ret){

                var index = dialog.loading();

                if (ret.status == 0) {

                    var name = $(this.item).attr('data-name');

                    // 上传完毕回调

                    if (multiple) {

                        // 上传多图
                        $(this.item).parent().find('.m-pics ul').append('<li><img src="' + ret.data.attach_uri + '" alt="" /><input type="hidden" name="' + name + '[desc][]" value="' + ret.data.id + '" /><a class="u-item"><i class="icon icon-remove"></i></a><input type="hidden" name="' + name + '[value][]" value="' + ret.data.id + '" /></li>');
                    } else {

                        // 上传单图

                        $(this.item).parent().find('.m-pic ul').html('<li><img src="' + ret.data.attach_uri + '" alt="" /><a class="u-item"><i class="icon icon-remove"></i></a><input type="hidden" name="' + name + '" value="' + ret.data.id + '" /></li>');

                    }

                    layer.close(index);

                } else {

                    dialog.error(ret.message);

                    layer.close(index);
                }
            }
        })
    }


    /**
     * 上传图片
     * @param  {object}  uploader upload 对象
     * @param  {string}  ele      容器选择器
     * @param  {boolean} multiple 是否允许多图上传
     */
    function sxupload_pic(uploader, ele, multiple)
    {
        var signature = setSign();
        uploader.render({
            elem: ele,
            field: 'imgFile',
            multiple: multiple,
            url: '<?php echo url("api/v1/upload", ["path" => session("userid", "", session_prefix()), "type" => "image", "module" => request()->module() ?: "addons"]); ?>',
            headers: {signature: signature},
            done: function(ret){
                var index = dialog.loading();
                if (ret.status == 0) {
                    var name = $(this.item).attr('data-name');
                    // 上传完毕回调
                    if (multiple) {
                        // 上传多图
                        $(this.item).parent().find('.m-pics ul').append('<li><img src="' + ret.data.attach_uri + '" alt="" /><a class="u-item"><i class="icon icon-remove"></i></a><input type="hidden" name="' + name + '[value][]" value="' + ret.data.id + '" /></li>');
                    } else {
                        // 上传单图
                        $(this.item).parent().find('.m-pic ul').html('<li><img src="' + ret.data.attach_uri + '" alt="" /><a class="u-item"><i class="icon icon-remove"></i></a><input type="hidden" name="' + name + '" value="' + ret.data.id + '" /></li>');
                    }
                    layer.close(index);
                } else {
                    dialog.error(ret.message);

                    layer.close(index);
                }

            }

        })

    }



    /**

     * 上传附件

     * @param  {object}  uploader upload 对象

     * @param  {string}  ele      容器选择器

     */

    function upload_file(uploader, ele)

    {

        uploader.render({

            elem: ele,

            field: 'imgFile',

            accept: 'file',

            url: '<?php echo url("manage/upload/filemanager", ["path" => session("userid", "", session_prefix()), "type" => "file", "module" => request()->module() ?: "addons"]); ?>',

            done: function(ret){

                var index = dialog.loading();

                if (ret.status == 0) {

                    var name = $(this.item).attr('data-name');

                    // 上传完毕回调

                    $(this.item).parent().find('.m-files ul').append('<li><i class="icon-paper-clip"></i><input type="text" name="'+name+'[name][]" value="' + ret.data.title + '" /><a data-md5-file="' + ret.data.md5_file + '" data-id="' + ret.data.id + '" class="u-download">下载</a><a class="u-item" data-id="' + ret.data.id + '">删除</a><input type="hidden" name="' + name + '[value][]" value="' + ret.data.id + '" /></li>');

                    $(this.item).parent().find('.m-files').show();

                    layer.close(index);

                } else {

                	

                    dialog.error(ret.message);



                    layer.close(index);

                }

            }

        })

    }



    layui.use(['upload'], function(ele, multiple){

        // 得到 upload 对象

        var upload = layui.upload;

        // 上传单图

        upload_pic(upload, '.u-upload-pic', false);

        // 上传多图

        upload_pic(upload, '.u-upload-pics', true);

        // 上传附件

        upload_file(upload, '.u-upload-file');

        //双喜
        sxupload_pic(upload, '.sxu-upload-pic', false);
        sxupload_pic(upload, '.sxu-upload-pics', true);
    });

</script>

</body>
</html>